package org.springsecuritylearn.admin.support;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hyf
 * @Title: ${file_name}
 * @Package org.springsecuritylearn.admin.support
 * @Description: ${todo}
 * @date 2018/5/5下午11:51
 */
@RestControllerAdvice
public class ExceptionHandle {


    @ExceptionHandler(RuntimeException.class)
    @ResponseStatus
     public Map<String,Object> handleException(RuntimeException exception){
        Map<String,Object> result=new HashMap<String,Object>();
        result.put("errorMsg", exception.getStackTrace());
        return result;
    }

}
